
/* First created by JCasGen Mon Mar 28 12:51:53 CEST 2011 */
package ia1011.zanzibar.chaos.type;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;

/** A Paragraph is a collection of Phrases related to the same paragraph of a subject of analysis.
 * Updated by JCasGen Mon Mar 28 12:52:46 CEST 2011
 * @generated */
public class UimaParagraph_Type extends Annotation_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (UimaParagraph_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = UimaParagraph_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new UimaParagraph(addr, UimaParagraph_Type.this);
  			   UimaParagraph_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new UimaParagraph(addr, UimaParagraph_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = UimaParagraph.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("ia1011.zanzibar.chaos.type.UimaParagraph");
 
  /** @generated */
  final Feature casFeat_id;
  /** @generated */
  final int     casFeatCode_id;
  /** @generated */ 
  public int getId(int addr) {
        if (featOkTst && casFeat_id == null)
      jcas.throwFeatMissing("id", "ia1011.zanzibar.chaos.type.UimaParagraph");
    return ll_cas.ll_getIntValue(addr, casFeatCode_id);
  }
  /** @generated */    
  public void setId(int addr, int v) {
        if (featOkTst && casFeat_id == null)
      jcas.throwFeatMissing("id", "ia1011.zanzibar.chaos.type.UimaParagraph");
    ll_cas.ll_setIntValue(addr, casFeatCode_id, v);}
    
  
 
  /** @generated */
  final Feature casFeat_caseSensitive;
  /** @generated */
  final int     casFeatCode_caseSensitive;
  /** @generated */ 
  public boolean getCaseSensitive(int addr) {
        if (featOkTst && casFeat_caseSensitive == null)
      jcas.throwFeatMissing("caseSensitive", "ia1011.zanzibar.chaos.type.UimaParagraph");
    return ll_cas.ll_getBooleanValue(addr, casFeatCode_caseSensitive);
  }
  /** @generated */    
  public void setCaseSensitive(int addr, boolean v) {
        if (featOkTst && casFeat_caseSensitive == null)
      jcas.throwFeatMissing("caseSensitive", "ia1011.zanzibar.chaos.type.UimaParagraph");
    ll_cas.ll_setBooleanValue(addr, casFeatCode_caseSensitive, v);}
    
  
 
  /** @generated */
  final Feature casFeat_surface;
  /** @generated */
  final int     casFeatCode_surface;
  /** @generated */ 
  public String getSurface(int addr) {
        if (featOkTst && casFeat_surface == null)
      jcas.throwFeatMissing("surface", "ia1011.zanzibar.chaos.type.UimaParagraph");
    return ll_cas.ll_getStringValue(addr, casFeatCode_surface);
  }
  /** @generated */    
  public void setSurface(int addr, String v) {
        if (featOkTst && casFeat_surface == null)
      jcas.throwFeatMissing("surface", "ia1011.zanzibar.chaos.type.UimaParagraph");
    ll_cas.ll_setStringValue(addr, casFeatCode_surface, v);}
    
  
 
  /** @generated */
  final Feature casFeat_sentences;
  /** @generated */
  final int     casFeatCode_sentences;
  /** @generated */ 
  public int getSentences(int addr) {
        if (featOkTst && casFeat_sentences == null)
      jcas.throwFeatMissing("sentences", "ia1011.zanzibar.chaos.type.UimaParagraph");
    return ll_cas.ll_getRefValue(addr, casFeatCode_sentences);
  }
  /** @generated */    
  public void setSentences(int addr, int v) {
        if (featOkTst && casFeat_sentences == null)
      jcas.throwFeatMissing("sentences", "ia1011.zanzibar.chaos.type.UimaParagraph");
    ll_cas.ll_setRefValue(addr, casFeatCode_sentences, v);}
    
   /** @generated */
  public int getSentences(int addr, int i) {
        if (featOkTst && casFeat_sentences == null)
      jcas.throwFeatMissing("sentences", "ia1011.zanzibar.chaos.type.UimaParagraph");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_sentences), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_sentences), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_sentences), i);
  }
   
  /** @generated */ 
  public void setSentences(int addr, int i, int v) {
        if (featOkTst && casFeat_sentences == null)
      jcas.throwFeatMissing("sentences", "ia1011.zanzibar.chaos.type.UimaParagraph");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_sentences), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_sentences), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_sentences), i, v);
  }
 



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public UimaParagraph_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_id = jcas.getRequiredFeatureDE(casType, "id", "uima.cas.Integer", featOkTst);
    casFeatCode_id  = (null == casFeat_id) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_id).getCode();

 
    casFeat_caseSensitive = jcas.getRequiredFeatureDE(casType, "caseSensitive", "uima.cas.Boolean", featOkTst);
    casFeatCode_caseSensitive  = (null == casFeat_caseSensitive) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_caseSensitive).getCode();

 
    casFeat_surface = jcas.getRequiredFeatureDE(casType, "surface", "uima.cas.String", featOkTst);
    casFeatCode_surface  = (null == casFeat_surface) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_surface).getCode();

 
    casFeat_sentences = jcas.getRequiredFeatureDE(casType, "sentences", "uima.cas.FSArray", featOkTst);
    casFeatCode_sentences  = (null == casFeat_sentences) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_sentences).getCode();

  }
}



    